Recursion depth exceeding in a python function for counting reverse pairs

welcome to shbcf.ru